package com.lmaye.design.patterns.ood.lod.example;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * -- College Manager
 *
 * @author lmay.Zhou
 * @date 2020/11/12 22:43 星期四
 * @qq 379839355
 * @email lmay@lmaye.com
 * @since JDK1.8
 */
public class CollegeManager {
    public List<CollegeEmployee> getCollegeEmployees() {
        List<CollegeEmployee> collegeEmployees = new ArrayList<>();
        CollegeEmployee employee;
        for(int i=0; i<5; ++i) {
            employee = new CollegeEmployee();
            employee.setId("学院总部人员ID: " + i);
            collegeEmployees.add(employee);
        }
        return collegeEmployees;
    }

    public void printAllEmployee(SchoolManager schoolManager) {
        System.out.println("--------------- 学校人员 ---------------");
        List<SchoolEmployee> schoolEmployees = schoolManager.getSchoolEmployees();
        schoolEmployees.stream().map(SchoolEmployee::getId).collect(Collectors.toList()).forEach(System.out::println);
        System.out.println("--------------- 学院总部人员 ---------------");
        getCollegeEmployees().stream().map(CollegeEmployee::getId).collect(Collectors.toList()).forEach(System.out::println);
    }
}
